/****************************************************
          File Name:17-1.cpp
          Author: Abby Cin
          Mail: abbytsing@gmail.com
          Created Time: Mon Jan 19 17:24:53 2015
*****************************************************/

#include<iostream>
using namespace std;

int main()
{
    char ch;
    int count = 0;

    cin.get(ch);
    while(ch != '$')
    {
        count++;
        cin.get(ch);
    }

    cout << "entered " << count << " charactors before"
        << "next charactor: " << ch << endl;

    return 0;
}
